package com.wzw.basics.concurrent.thread.future;

import com.sun.deploy.util.SyncAccess;

import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;

/**
 * @author Wangzhiwen
 */
public class FutureTaskApi {

    public static void main(String[] args) {

    }

    public static void create() {
        FutureTask<String> futureTask = new FutureTask<>(() -> {
            TimeUnit.SECONDS.sleep(5);
            return "thread call";
        });
        futureTask.run();
    }

}
